﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Interface;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class HeDaoTaoRepository:IHeDaoTaoRepository
    {
        DangKyPhuEntities entities;

        public HeDaoTaoRepository()
        {
            entities = new DangKyPhuEntities();
        }
        #region Repository
        SinhVienRepository svRepo = new SinhVienRepository();
        #endregion
        public HeDaoTao LayHeDaoTaoTuMaSV(string maSV)
        {
            SinhVien sinhVien = svRepo.LaySVTuMaSV(maSV);
            return (from m in entities.HeDaoTaos
                    where m.HeDaoTaoID == sinhVien.Lop.HeDaoTaoID
                    select m).FirstOrDefault();
        }
    }
}
